const Koa = require("koa");
const app = new Koa();

/* const mongodb = require("mongodb");

const { MongoClient } = require("mongodb");

const client = new MongoClient("mongodb://localhost:27017");

// Database Name
const dbName = "koa";

async function main() {
  // Use connect method to connect to the server
  await client.connect();
  console.log("Connected successfully to server");
  const db = client.db(dbName);
  const collection = db.collection("documents");

  // the following code examples can be pasted here...

  return "done.";
}

main()
  .then(console.log("link good"))
  .catch((err) => console.error("link fail"));
   .finally(() => client.close());
 */

// const { mongodb } = require("./db");
// mongodb();
// app.use((ctx) => {
//   ctx.body = "good";
// });

const { mongoose } = require("./mongoose");
mongoose();

app.listen(3000, () => {
  console.log("3000 running");
});
